<template>
  <div>
    <!-- <el-card>
      <div slot="header" class="clearfix">
        <span class="title">通讯录</span>
        <span style="float: right">查看全部</span>
      </div>
      <el-input
        placeholder="请输入内容"
        v-model="searchValue"
        class="input-with-select"
      >
        <el-button slot="append" type="primary">查找</el-button>
      </el-input>
    </el-card> -->
    <el-card>
      <div slot="header" class="clearfix">
        <span class="title">常用功能</span>
      </div>
      <div class="itemBox">
        <div v-for="item in itemList" class="item" @click="handleadd(item)">
          <div style="height: 45px; line-height: 54px">
            <svg-icon
              :className="'class-icon ' + 's' + item.color"
              :icon-class="item.icon"
              @click="click"
            />
          </div>
          <div class="label">{{ item.label }}</div>
        </div>
      </div>
    </el-card>
  </div>
</template>
<script>
export default {
  data() {
    return {
      itemList: [
        {
          label: "新增新闻",
          path: "/company/index?add=true",
          icon: "addNews",
          color: "4892FE",
          permiss: "company:news:add",
        },
        {
          label: "新增公告",
          path: "/company/notice?add=true",
          icon: "addnotice",
          color: "size2",
          permiss: "company:notice:add",
        },
        {
          label: "新增红头文件",
          path: "/setup/file/addFile",
          icon: "addfile",
          color: "size3",
          permiss: "system:file:add",
        },
        {
          label: "新增知识库",
          path: "/company/knowledge?add=true",
          icon: "addKn",
          color: "4892FE",
          permiss: "company:knowledge:add",
        },
        {
          label: "新增证书",
          path: "/setup/certificate?add=true",
          icon: "addzs",

          permiss: "company:certificate:add",

          color: "4892FE",
        },
        {
          label: "新增人员",
          path: "/finance/personnel/fileAdd",
          permiss: "personnel:file:fileAdd",
          icon: "adduser",
          color: "4892FE",
        },
        {
          label: "采购设备",
          path: "/setup/equipment/addBuy",
          permiss: "equipment:buy:addPage",

          icon: "adddeveice",
          color: "size36",
        },
        {
          label: "新增文件",
          path: "/setup/file/addFile",
          permiss: "system:file:add",

          icon: "xzwj",
          color: "4892FE",
        },
        {
          label: "新增标准",
          path: "/setup/standard/addStandard",
          permiss: "system:standard:addPage",

          icon: "xzbj",
          color: "4892FE",
        },
        {
          label: "我的流程",
          path: "/work/own",
          permiss: "workflow:process:ownList",

          icon: "myflow",
          color: "size",
        },
        {
          label: "我的代办",
          path: "/work/todo",
          icon: "mddb",
          color: "size36",
          permiss: "workflow:process:todoList",
        },
        {
          label: "车检提醒",
          path: "/vehicle/remind",
          permiss: "vehicle:remind:list",

          icon: "cjtx",
          color: "4892FE",
        },
      ],
      activeName: "first",
      searchValue: "",
    };
  },
  methods: {
    handleadd(e) {
      if (this.$auth.hasPermi(e.permiss)) {
        this.$router.push(e.path);
      } else {
        this.$message.warning("您暂无权限访问，请联系负责人配置，谢谢！");
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.ssize2 {
  font-size: 48px !important;
  margin-top: -5px;
}
.ssize3 {
  margin-top: -4px;
  font-size: 50px !important;
}
.label {
  margin: 15px 0;
}
.class-icon {
  font-size: 40px;
}
.ssize {
  font-size: 34px;
}
.ssize32 {
  font-size: 32px;
}
.ssize36 {
  font-size: 36px;
}
.itemBox {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  .item {
    cursor: pointer;
    text-align: center;
    width: 30%;
    font-size: 14px;
  }
}
.title {
  font-weight: 500;
}
::v-deep.el-button--primary {
  color: #ffffff !important;
  background-color: #1890ff !important;
  border-color: #1890ff !important;
  border-radius: 0;
  border: 0 !important;
}
</style>
